# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kimageannotator
pkgver=0.6.1
pkgrel=0
pkgdesc="Tool for annotating images"
url="https://github.com/ksnip/kImageAnnotator"
arch="all"
license="LGPL-3.0-or-later"
depends_dev="
	kcolorpicker-dev
	qt5-qtbase-dev
	qt5-qtsvg-dev
	qt5-qttools-dev
	"
makedepends="$depends_dev
	cmake
	gtest-dev
	samurai
	"
subpackages="$pkgname-dev"
source="https://github.com/ksnip/kImageAnnotator/archive/v$pkgver/kimageannotator-$pkgver.tar.gz"
builddir="$srcdir/kImageAnnotator-$pkgver"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=TRUE \
		-DBUILD_TESTS=ON \
		-DBUILD_EXAMPLE=OFF
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
92ec8ff06011856e98e5624f9c3d98227e10991385fa41e110187db9b5d7b8de075199844e886618668040b69f8910be51b8cf55a009fac8887954c5b7695b25  kimageannotator-0.6.1.tar.gz
"
